﻿using ESC.DB;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using System.Windows.Data;

namespace ESC.Designer.Resources
{
    public class RuncardStateExConvert : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            RuncardInfoView view = value as RuncardInfoView;
            if (view != null && view.Stauts != "" && view.Status != "")
            {
                if (view.Status == "C")
                {
                    return "正常結案";
                }
                else if (view.Status == "H")
                {
                    return "手動結案";
                }
                else if (view.Status == "F")
                {
                    return "作廢結案";
                }
                else if (view.Status == "U")
                {
                    return "并批結案";
                }
                else if (view.Stauts == "F")
                {
                    return "作廢結案";
                }
                else if (view.Status == "N")
                {
                    return "生產中";
                }
                else
                {
                    return "";
                }
            }
            else
            {
                return "";
            }
        }

        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}
